﻿using personalplaner.common;
using personalplaner.common.mvvm.factory;
using personalplaner.servicemodel.dataaccess;

namespace personalplaner.gui.plugins.dienstplan.viewmodels.factories
{
    public class CreateNewPlanModelFactory : IFactory
	{
		#region IFactory Members
		
		public object CreateViewModel(System.Windows.DependencyObject sender)
        {
            var vm = new CreateNewPlanViewModel(sender);

			vm.ServiceLocator.RegisterService<IPlanSchemaDataAccess>(new PlanSchemaDataAccess(SettingsProvider.Settings));
			vm.ServiceLocator.RegisterService<IPlanDataAccess>(new PlanDataAccess(SettingsProvider.Settings));
			vm.ServiceLocator.RegisterService<ICommonDataAccess>(new CommonDataAccess(SettingsProvider.Settings));

            return vm;
		}

		#endregion
	}
}
